package com.admin.contoller;

//import com.jumi.po.*;
//import com.jumi.service.NewsService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value="/news")
public class NewsController {

    private static Logger logger = Logger.getLogger(NewsController.class);

//    @Autowired
//    private NewsService newsService;

    @RequestMapping(value="/list")
    public String list(HttpServletRequest request, Model model) throws Exception{
        return "news/news_list";
    }
//    @ResponseBody
//    @RequestMapping(value="/listJson")
//    public DataGrid<News> listJson(HttpServletRequest request, Model model) throws Exception{
//        Page<News> page = new Page<News>();
//        News news = new News();
//        String name = request.getParameter("name");
//        if(name != null && !"".equals(name)){
//            news.setName(name);
//        }
//        String currentPage = request.getParameter("page");
//        if(currentPage != null && !"".equals(currentPage)){
//            page.setCurrentPage(Integer.parseInt(currentPage));
//        }
//        String limit = request.getParameter("limit");
//        if(limit != null && !"".equals(limit)){
//            page.setPageSize(Integer.parseInt(limit));
//        }
//        page.setT(news);
//        page = newsService.getNewsPageList(page);
//        DataGrid<News> dg = new DataGrid<News>();
//        dg.setMsg("");
//        dg.setCode(0);
//        dg.setCount(page.getTotalCount());
//        dg.setData(page.getList());
//        return dg;
//    }
}
